<template>
  <div class="common-layout">
    <el-container class="el-container">
      <el-aside class="aside" width="200px">
        <div class="Logo">交通仿真后台管理系统</div>
        <el-menu
          background-color="#001529"
          text-color="#fff"
          :default-active="route.name"
          class="el-menu-vertical-demo"
          unique-opened
          router
        >
          <el-sub-menu index="lightManage">
            <template #title>
              <el-icon><Histogram /></el-icon>
              <span>SUMO仿真</span>
            </template>
            <el-menu-item index="lightManage">交通仿真</el-menu-item>
            <el-menu-item index="commentManage">评价指标</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="carStatus">
            <template #title>
              <el-icon><location /></el-icon>
              <span>交通元素管理</span>
            </template>
            <el-menu-item index="carStatus">流量管理</el-menu-item>
            <el-menu-item index="carInfo">路网管理</el-menu-item>
            <el-menu-item index="checkManage">检测器管理</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="userManage">
            <template #title>
              <el-icon><TakeawayBox /></el-icon>
              <span>用户管理</span>
            </template>
            <el-menu-item index="userManage">用户设置</el-menu-item>
          </el-sub-menu>
        </el-menu></el-aside
      >
      <el-container>
        <el-header class="header">
          <NavBar />
        </el-header>
        <el-main><RouterView></RouterView></el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { useRoute } from "vue-router";
import NavBar from "@/pages/layouts/components/NavBar.vue";
const route = useRoute();
</script>

<style scoped lang="scss">
.common-layout {
  width: 100%;
  height: 100%;
  .el-container {
    height: 100%;
    .header {
      border-bottom: 1px solid #ccc;
    }
    .aside {
      background-color: #001529;
      height: 100%;
      .Logo {
        text-align: center;
        line-height: 60px;
        height: 60px;
        color: #fff;
        font-weight: bold;
      }
      .el-menu-vertical-demo {
        height: calc(100% - 60px);
      }
    }
  }
}
</style>
